package com.panku.common.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: jack
 * @Description:
 * @Date Create in 16:15 2021-02-01
 **/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result {

    private int code;

    private String msg;

    private Object data;

    public static Result ok() {
        return ok(null);
    }

    public static Result ok(Object data) {
        return new Result(200, "操作成功", data);
    }

    public static Result err(int code, String msg) {
        return new Result(code, msg, null);
    }

    public static Result err() {
        return err(0, "操作失败");
    }


}
